package com.hd.appcommon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hd.appcommon.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色 Mapper 接口
 * </p>
 *
 * @author administrator
 * @since 2020-11-30
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("  select r.* from role r " +
            "  inner join org_member_role mr " +
            "  on r.role_id = mr.role_id " +
            "  where mr.org_member_id = #{teacherId} " +
            "  and r.role_status = #{roleStatus} ")
    List<Role> listByOrgMemberId(@Param("teacherId") String teacherId, @Param("roleStatus") Integer roleStatus);
}
